package com.itheima.String;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        String username = "hlqzz";
        String password = "05191415";

        Scanner sc = new Scanner(System.in);
        for (int i = 2; i >=0 ; i--) {
            System.out.println("请输入用户名:");
            String scUsername = sc.nextLine();
            System.out.println("请输入密码:");
            String scPassword = sc.nextLine();

            if(username.equals(scUsername) && password.equals(scPassword)){
                System.out.println("登陆成功");
                break;
            }else{
               if(i ==0){
                   System.out.println("您的登录次数已达今日上限,请明天再来");
               }else{
                   System.out.println("登陆失败,您还会剩余" + i + "次机会");
               }
            }
        }
    }
}
